package com.taobao.txc.common.config;

import com.taobao.diamond.client.impl.DiamondEnv;
import com.taobao.diamond.client.impl.DiamondEnvRepo;
import com.taobao.txc.common.LoggerInit;
import com.taobao.txc.common.LoggerWrap;

public class g
  extends i
{
  private static final LoggerWrap k = LoggerInit.logger;
  
  public g()
  {
    String str1 = System.getProperty("diamond.txc.server.ip");
    if ((str1 == null) || (str1.isEmpty())) {
      str1 = System.getProperty("diamond.server.ip");
    }
    String str2;
    if ((str1 == null) || (str1.isEmpty()))
    {
      k.info("try diamond default");
      this.a = DiamondEnvRepo.defaultEnv;
    }
    else
    {
      str2 = System.getProperty("diamond.txc.server.port");
      str1 = a(str1);
      if ((str2 == null) || (str2.isEmpty()))
      {
        k.info("try diamond " + str1);
        this.a = new DiamondEnv(new String[] { str1 });
      }
      else
      {
        try
        {
          int i = a(Integer.parseInt(str2));
          k.info("try diamond " + str1 + " port " + i);
          this.a = h.a(i, new String[] { str1 });
        }
        catch (Exception localException)
        {
          k.info("try diamond " + str1);
          this.a = new DiamondEnv(new String[] { str1 });
        }
      }
    }
    try
    {
      str2 = this.a.getConfig("com.taobao.txc.rules.global", "TXC_GROUP", 5000L);
      if (str2 == null) {
        throw new RuntimeException("default diamond is invalid txc diamond");
      }
    }
    catch (Throwable localThrowable)
    {
      throw new RuntimeException(localThrowable);
    }
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.common.config.g
 * JD-Core Version:    0.7.0.1
 */